package com.cskaoyan.bean;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;

@Data
public class Coupon {
    private Integer id;

    private String name;

    private String desc;

    private String tag;

    @NotNull
    @Min(0)
    private Integer total;

    @NotNull
    @Min(0)
    private BigDecimal discount;

    @NotNull
    @Min(0)
    private BigDecimal min;

    @NotNull
    @Min(0)
    @Max(1)
    private Short limit;

    private Short type;

    private Short status;

    private Short goodsType;

    private Integer[] goodsValue;

    private String code;

    private Short timeType;

    @NotNull
    @Min(1)
    private Short days;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date startTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date endTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date addTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;

    private Boolean deleted;
}